<?php

namespace common\models\minisite;

use Yii;

/**
 * This is the model class for table "d_mini.t_activity_show".
 *
 * @property integer $id
 * @property string $c_name
 * @property integer $c_image
 * @property integer $c_sort
 * @property string $c_begin
 * @property string $c_end
 * @property integer $c_status
 * @property string $c_content
 * @property string $db_time
 * @property integer $op_id
 */
class MActivityShow extends \yii\db\ActiveRecord
{
    
    public static $STATUS = [0=>'下线', 1=>'上线'];
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'd_mini.t_activity_show';
    }
    public static function getDb()
    {
        return Yii::$app->get('db');
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['c_name','c_sort','c_status','c_content','c_image'],'required'],
            [['c_image', 'c_sort', 'c_status', 'op_id'], 'integer'],
            [['c_begin', 'c_end', 'db_time','op_id'], 'safe'],
            [['c_content'], 'string'],
            [['c_name'], 'string', 'max' => 10],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'c_name' => '活动标题',
            'c_image' => '活动展示图',
            'c_sort' => '权重',
            'c_begin' => '活动开始时间',
            'c_end' => '活动结束时间',
            'c_status' => '显示状态',
            'c_content' => '活动详情内容',
            'db_time' => '录入时间',
            'op_id' => '管理员',
        ];
    }

    /**
     * @inheritdoc
     * @return \services\models\minisite\TActivityShowQuery the active query used by this AR class.
     */
    public static function find()
    {
        return new \services\models\minisite\TActivityShowQuery(get_called_class());
    }


}
